﻿using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Kaskelot.SP.Model.Contracts;
using Kaskelot.SP.Services;
using Stockholm.SOA.Kaskelot.WCF.DataContracts;

namespace Kaskelot.SP.UI.CONTROLTEMPLATES.Kaskelot.SP.UI.Forms
{
	public partial class SkyltForm : BaseForm, IForm
	{
		public string Id { get; set; }
		public string ParentId { get; set; }
		public Skylt Current { get; set; }

		protected void Page_Load(object sender, EventArgs e)
		{
			using (ByggnadService svc = new ByggnadService())
			{
				try
				{
					Current = svc.GetSkylt(new Guid(Id));
				}
				catch
				{

				}

				if (Current == null)
					Current = new Skylt();
			}
		}

		public string GetChecked()
		{
			if (Current.LiggerIVaskan)
				return "checked=\"checked\"";
			else
				return String.Empty;
		}
	}
}
